import 'package:flutter/foundation.dart';
import 'package:flutter/material.dart';
import 'package:uikit/theme/riki_base_theme.dart';
import 'package:uikit/theme/riki_splash_factory.dart';

import '../fonts/riki_font.dart';

class RikiRedTheme extends RikiBaseTheme {
  @override
  Color get primary => const Color(0xFFFA4D32);

  @override
  MaterialColor get primarySwatch => MaterialColor(
        primary.value,
        <int, Color>{
          50: const Color(0xFFFEEAE6),
          100: const Color(0xFFFECAC2),
          200: const Color(0xFFFDA699),
          300: const Color(0xFFFC8270),
          400: const Color(0xFFFB6851),
          500: primary,
          600: const Color(0xFFF9462D),
          700: const Color(0xFFF93D26),
          800: const Color(0xFFF8341F),
          900: const Color(0xFFF62513),
        },
      );

  @override
  List<Color> get primaryGradientColors => const <Color>[
        Color(0xFFFA3B34),
        Color(0xFFFF6A33),
      ];

  /// 辅助色渐变值
  @override
  List<Color> get gradientColors => const <Color>[
        Color(0xffff6357),
        Color(0xfff83112),
        Color(0xfffd4e0f),
        Color(0xfffd6421),
        Color(0xffff7f1e),
        Color(0xfffb9701),
      ];

  /// 金额颜色
  @override
  Color get price => const Color(0xfff83112);

  /// 灰色
  @override
  Color get shade50 => const Color(0xFFFCFCFC);

  @override
  Color get shade100 => const Color(0xFFF6F6F6);

  @override
  Color get shade200 => const Color(0xFFF2F2F2);

  @override
  Color get shade300 => const Color(0xFFE8E8E8);

  @override
  Color get shade400 => const Color(0xFFCCCCCC);

  @override
  Color get shade500 => const Color(0xFF999999);

  @override
  Color get shade600 => const Color(0xFF666666);

  @override
  Color get shade700 => const Color(0xFF333333);

  @override
  Color get shade800 => const Color(0xFF222222);

  @override
  Color get shade900 => const Color(0xFF111111);

  /// 成功色
  @override
  Color get success => const Color(0xFF2DA24A);

  @override
  Color get successLight => const Color(0xFFC2E5CB);

  @override
  Color get successDark => const Color(0xFF2DA24A);

  @override
  Color get successBackground => const Color(0xFFF5FCF6);

  /// 警告色
  @override
  Color get warning => const Color(0xFFFF7F1E);

  @override
  Color get warningLight => const Color(0xFFFFD9BC);

  @override
  Color get warningDark => const Color(0xFFFF7F1E);

  @override
  Color get warningBackground => const Color(0xFFFCF8F5);

  /// 危险色
  @override
  Color get danger => const Color(0xFFF5432D);

  @override
  Color get dangerLight => const Color(0xFFFCC7C0);

  @override
  Color get dangerDark => const Color(0xFFF5432D);

  @override
  Color get dangerBackground => const Color(0xFFFEF7F6);

  @override
  ThemeData get theme {
    return ThemeData(
      primaryColor: primary,
      primarySwatch: primarySwatch,
      scaffoldBackgroundColor: shade100,
      splashColor: Colors.transparent,
      //关闭按钮类水波纹
      highlightColor: Colors.transparent,
      //关闭按钮类水波纹
      splashFactory: RikiSplashFactory(),
      //关闭水波纹
      //accentColor: shade50,
      //修改列表水波纹颜色
      fontFamily: materialFontFamily(defaultTargetPlatform), // 设置字体样式
    );
  }

  String? materialFontFamily(TargetPlatform targetPlatform) {
    if (targetPlatform == TargetPlatform.iOS) {
      return RikiFont.PingFangSC;
    } else {
      return null;
    }
  }
}
